<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<script type="text/javascript" src="../js/jquery-3.3.1.js"></script>
<body>
	用户审核
	<table id="userTab" border="1px" cellpadding="0px"  cellpadding="0px">
	</table>
</body>
<script type="text/javascript">
	$(function(){
		showUserUncheck();
		function showUserUncheck(){
			var tab = "<tr><th>用户ID<th><th>用户名<th><th>姓名<th><th>年龄<th><th>性别<th><th>电话<th><th>操作<th><tr>";
			$("#userTab").html(tab);
			$.ajax({
				url:'findUserUncheck',
				method:'get',
				contentType:'application/json',
				dataType:'json',
				success:function(data){
					$.each(data,function(){
						var tr = "<tr><td>"+this.userId+"<td>"+
						 "<td>"+this.userName+"<td>"+
						 "<td>"+this.presonName+"<td>"+
						 "<td>"+this.personAge+"<td>"+
						 "<td>"+this.personSex+"<td>"+
						 "<td>"+this.telephone+"<td>"+
						 "<td><a id='passUser"+this.userId+"' href='javascript:void(0);'>通过</a>/<a id='deleteUser"+this.userId+"' href='javascript:void(0);'>不通过</a><td><tr>";
						$('#userTab').append(tr);
						var id = this.userId;
						var passAId= "#passUser"+id;
						var deleteAId= "#deleteUser"+id;
						$(passAId).click(function(){
							$.ajax({
								url:'passUser',
								method:'get',
								contentType:'application/json',
								dataType:'json',
								data:{'userId':id},
								success:function(data){
									showUserUncheck();
								}
							});
						});
						$(deleteAId).click(function(){
							$.ajax({
								url:'deleteUser',
								method:'get',
								contentType:'application/json',
								dataType:'json',
								data:{'userId':id},
								success:function(data){
									showUserUncheck();
								}
							});
						});
					});
				}
			});
		}
	})
</script>
</html>